Learn R Programming

MTurkR (version 0.2)

Blocking Workers: Block/Unblock Worker(s)

Description

Block or unblock a worker. This prevents a worker from completing any HITs for you while they are blocked, but does not affect their ability to complete work for other requesters or affect their worker statistics. GetBlockedWorkers retrieves your list of currently blocked workers.

Usage

BlockWorker(workers, reasons, keypair = credentials(), 
			print = TRUE, browser = FALSE, log.requests = TRUE, sandbox = FALSE)

UnblockWorker(	workers, reasons = NULL, keypair = credentials(), 
				print = TRUE, browser = FALSE, log.requests = TRUE, sandbox = FALSE)

GetBlockedWorkers(pagenumber = NULL, pagesize = NULL, keypair = credentials(), 
				print = TRUE, browser = FALSE, log.requests = TRUE, sandbox = FALSE)

Arguments

workers
A character string containing a WorkerId, or a vector of character strings containing multiple WorkerIds.
reasons
A character string containing a reason for blocking or unblocking a worker. This must have length 1 or length equal to the number of workers. It is required for BlockWorker and optional for UnblockWorker.
pagenumber
An optional integer (or character string) indicating which page of Blocked Workers search results should be returned. Most users can ignore this.
pagesize
An optional integer (or character string) indicating how many Blocked Workers should be returned per page of results. Most users can ignore this.
keypair
A two-item character vector containing an AWS Access Key ID in the first position and the corresponding Secret Access Key in the second position. Set default with credentials.
print
Optionally print the results of the API request to the standard output. Default is TRUE.
browser
Optionally open the request in the default web browser, rather than opening in R. Default is FALSE.
log.requests
A logical specifying whether API requests should be logged. Default is TRUE. See readlogfile for details.
sandbox
Optionally execute the request in the MTurk sandbox rather than the live server. Default is FALSE.

Value

  • BlockWorker and UnblockWorker return a dataframe containing the list of workers, reasons (for blocking/unblocking them), and whether the request to block/unblock each of them was valid. GetBlockedWorkers returns a dataframe containing the list of blocked workers and the recorded reason for the block.

Details

BlockWorker prevents the specified worker from completing any of your HITs. UnblockWorker reverses this operation. GetBlockedWorkers retrieves currently blocked workers and the reason recorded for their block. This operation returns the first 65,535 blocked workers (the default for pagesize; access to additional blocked workers is available by specifying a pagenumber greater than 1. BlockWorkers() and block() are aliases for BlockWorker. UnblockWorkers() and unblock() are aliases for UnblockWorker. blockedworkers() is an alias for GetBlockedWorkers.

References

http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_BlockWorkerOperation.html{API Reference: Block} http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_UnblockWorkerOperation.html{API Reference: Unblock} http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_GetBlockedWorkersOperation.html{API Reference: GetBlockedWorkers}

Examples

Run this code
BlockWorker("A1RO9UEXAMPLE",reasons="Did not follow photo categorization HIT instructions.")
GetBlockedWorkers()
UnblockWorker("A1RO9UEXAMPLE")

Run the code above in your browser using DataLab